<?php
/* @var $headTitle Zend_View_Helper_HeadTitle */
$headTitle = $this->getHelper('HeadTitle');

// kolejność renderowania widoku.. z actionStack jest wcześniej niż z akcji z której jest stack (?!)
count($this->urlParams('fromSite'))
	? $headTitle->prepend($this->row['name'])
	: $headTitle->append($this->row['name']);

/* @var $headMeta Zend_View_Helper_HeadMeta */
$headMeta = $this->getHelper('HeadMeta');

!strlen($this->row['meta_keywords']) or $headMeta->setName('keywords', $this->row['meta_keywords']);
!strlen($this->row['meta_description']) or $headMeta->setName('description', $this->row['meta_description']);

$time_create = strtotime($this->row['time_create']);

$content = $this->row['description'];
$flashcontentId = 'flashcontent-' . $this->row['id'];

/* @var $headScript Zend_View_Helper_HeadScript */
$headScript = $this->getHelper('HeadScript');
$headScript->appendFile('js/swfobject.js');

/* @var $headScript Zend_View_Helper_InlineScript */
$inlineScript = $this->getHelper('inlineScript');
$inlineScript->captureStart();
?>
var fo = new SWFObject("js/autoviewer/autoviewer.swf", "autoviewer", "100%", "100%", "8", "#181818");		
				
//Optional Configuration
fo.addVariable("langOpenImage", "Otwórz fotografie w nowym oknie");
fo.addVariable("langAbout", "Informacje");	
fo.addVariable("xmlURL", "<?php print $this->url(array('format' => 'xml', 'action' => 'display', 'controller' => 'album', 'module' => 'gallery', 'id' => $this->row['id'], 'type' => $this->type), 'default', true)?>");					

fo.write("<?php print $flashcontentId?>");
<?php $inlineScript->captureEnd();?>

<?php if (false !== $this->displayContent):?>
<dl class="kx_gallery_album kx_display">
	<dt class="kx_time">
		<em class="kx_day"><?php print date('d', $time_create)?></em>
		<em class="kx_month"><?php print $this->translate(strtolower(date('F', $time_create)))?></em>
		<em class="kx_year"><?php print date('Y', $time_create)?></em>		
	</dt>
	<dd class="kx_content">
		<div class="kx_head">
			<h3 class="kx_title"><?php print $this->row['name']?></h3>
		
			<?php if (count($site = $this->urlParams('fromSite'))):?>
				<a class="kx_back" href="<?php print $this->url(array('alias'=>$site['alias']),'site',true)?>">&laquo; powrót do strony <em><?php print $this->escape($site['name'])?></em></a>
			<?php else:?>
				<a class="kx_back" href="<?php print $this->url(array('action' => 'index','controller'=>'gallery','module'=>'gallery'),'default',true);?>">&laquo; powrót do spisu galerii</a>
			<?php endif;?>
		</div>

		<div class="kx_description"><?php print $this->getHelper('renderer')->render($content);?></div>
<?php endif;?>		
		<div id="<?php print $flashcontentId?>" class="flashcontent">Brak włączonej obsługi JavaScript i Flash Player. <a href="http://www.macromedia.com/go/getflashplayer/">Pobierz Flash player.</a> lub <a href="<?php print $this->url(array('type' => 'default'))?>">przeglądaj album w sposób naturalny</a></div>
<?php if (false !== $this->displayContent):?>
	</dd>
</dl>	
<?php endif;?>